module: Fix ABI change in 4.4.5
authorBen Hutchings <ben@decadent.org.uk>
Mon, 14 Mar 2016 23:20:37 +0000 (23:20 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 17 Mar 2016 01:25:23 +0000 (01:25 +0000)
Move the new kallsyms fields in struct module to the end and hide
them from genksyms.  Restore the old fields but leave them zeroed -
nothing outside the module loader and /proc/kallsyms implementation
should be, or appears to be, using them.

Gbp-Pq: Topic debian
Gbp-Pq: Name module-fix-abi-change-in-4.4.5.patch

include/linux/module.h

index b229a9961d029facd4e72e156ac3383d21f94f24..4a013cdb7d441889ed5cc76049e1763a4f895eee 100644 (file)
@@ -417,9 +417,10 @@ struct module {
 #endif
 
 #ifdef CONFIG_KALLSYMS
-       /* Protected by RCU and/or module_mutex: use rcu_dereference() */
-       struct mod_kallsyms *kallsyms;
-       struct mod_kallsyms core_kallsyms;
+       /* bwh: Old kallsyms state; now just padding for ABI compat */
+       Elf_Sym *symtab, *core_symtab;
+       unsigned int num_symtab, core_num_syms;
+       char *strtab, *core_strtab;
 
        /* Section attributes */
        struct module_sect_attrs *sect_attrs;
@@ -482,6 +483,12 @@ struct module {
        ctor_fn_t *ctors;
        unsigned int num_ctors;
 #endif
+
+#if defined(CONFIG_KALLSYMS) && !defined(__GENKSYMS__)
+       /* Protected by RCU and/or module_mutex: use rcu_dereference() */
+       struct mod_kallsyms *kallsyms;
+       struct mod_kallsyms core_kallsyms;
+#endif
 } ____cacheline_aligned;
 #ifndef MODULE_ARCH_INIT
 #define MODULE_ARCH_INIT {}